package com.echoesnet.echoesshortvideo.Persistence;

import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;
import android.arch.persistence.room.TypeConverter;
import android.arch.persistence.room.TypeConverters;
import android.support.annotation.NonNull;

/**
 * Copyright (C) 2018 科技发展有限公司
 * 完全享有此软件的著作权，违者必究
 *
 * @author ben
 * @version 1.0
 * @modifier
 * @createDate 2018/4/19 20:30
 * @description
 */
@Entity(tableName = "TinyVideoInfo")
public class TinyVideoInfoEntity {


    /**
     * commentNum : 0
     * content :
     * date : 1524621391848
     * extra : {}
     * followOrNot : 0
     * headPic : http://huisheng.ufile.ucloud.cn/qs_tx120_weichuan_xxhdpi.png
     * likeNum : 0
     * likeOrNot : 0
     * location :
     * music :
     * nickName : 用户100016
     * posx :
     * posy :
     * relatedUser : {}
     * shareNum : 0
     * showType : 1
     * thumbnails : http://waipai.ufile.ucloud.com.cn/trends_161258af.jpg
     * timeToNow : 26分钟前
     * url : http://waipai.ufile.ucloud.com.cn/trends_00387d71.mp4
     * userId : 100016
     * videoId : 1030
     */

    @ColumnInfo(name = "commentNum")
    private String commentNum;
    @ColumnInfo(name = "content")
    private String content;
    @ColumnInfo(name = "date")
    private String date;
    @ColumnInfo(name = "extra")
    @TypeConverters(ExtraBeanConverter.class)
    private ExtraBean extra;
    @ColumnInfo(name = "followOrNot")
    private String followOrNot;
    @ColumnInfo(name = "headPic")
    private String headPic;
    @ColumnInfo(name = "likeNum")
    private String likeNum;
    @ColumnInfo(name = "likeOrNot")
    private String likeOrNot;
    @ColumnInfo(name = "location")
    private String location;
    @ColumnInfo(name = "music")
    private String music;
    @ColumnInfo(name = "nickName")
    private String nickName;
    @ColumnInfo(name = "posx")
    private String posx;
    @ColumnInfo(name = "posy")
    private String posy;
    @ColumnInfo(name = "relatedUser")
    @TypeConverters(RelatedUserConverter.class)
    private RelatedUserBean relatedUser;
    @ColumnInfo(name = "shareNum")
    private String shareNum;
    @ColumnInfo(name = "showType")
    private String showType;
    @ColumnInfo(name = "thumbnails")
    private String thumbnails;
    @ColumnInfo(name = "timeToNow")
    private String timeToNow;
    @ColumnInfo(name = "url")
    private String url;
    @ColumnInfo(name = "userId")
    private String userId;
    @PrimaryKey
    @ColumnInfo(name = "videoId")
    @NonNull
    private String videoId;

    public String getCommentNum() {
        return commentNum;
    }

    public void setCommentNum(String commentNum) {
        this.commentNum = commentNum;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public ExtraBean getExtra() {
        return extra;
    }

    public void setExtra(ExtraBean extra) {
        this.extra = extra;
    }

    public String getFollowOrNot() {
        return followOrNot;
    }

    public void setFollowOrNot(String followOrNot) {
        this.followOrNot = followOrNot;
    }

    public String getHeadPic() {
        return headPic;
    }

    public void setHeadPic(String headPic) {
        this.headPic = headPic;
    }

    public String getLikeNum() {
        return likeNum;
    }

    public void setLikeNum(String likeNum) {
        this.likeNum = likeNum;
    }

    public String getLikeOrNot() {
        return likeOrNot;
    }

    public void setLikeOrNot(String likeOrNot) {
        this.likeOrNot = likeOrNot;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getMusic() {
        return music;
    }

    public void setMusic(String music) {
        this.music = music;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getPosx() {
        return posx;
    }

    public void setPosx(String posx) {
        this.posx = posx;
    }

    public String getPosy() {
        return posy;
    }

    public void setPosy(String posy) {
        this.posy = posy;
    }

    public RelatedUserBean getRelatedUser() {
        return relatedUser;
    }

    public void setRelatedUser(RelatedUserBean relatedUser) {
        this.relatedUser = relatedUser;
    }

    public String getShareNum() {
        return shareNum;
    }

    public void setShareNum(String shareNum) {
        this.shareNum = shareNum;
    }

    public String getShowType() {
        return showType;
    }

    public void setShowType(String showType) {
        this.showType = showType;
    }

    public String getThumbnails() {
        return thumbnails;
    }

    public void setThumbnails(String thumbnails) {
        this.thumbnails = thumbnails;
    }

    public String getTimeToNow() {
        return timeToNow;
    }

    public void setTimeToNow(String timeToNow) {
        this.timeToNow = timeToNow;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getVideoId() {
        return videoId;
    }

    public void setVideoId(String videoId) {
        this.videoId = videoId;
    }


    public static class ExtraBeanConverter {

        @TypeConverter
        public static ExtraBean toExtraBean(String str) {
            return str == null ? null : new ExtraBean();
        }

        @TypeConverter
        public static String toJson(ExtraBean bean) {
            return bean == null ? null : bean.toString();
        }
    }

    public static class RelatedUserConverter {

        @TypeConverter
        public static RelatedUserBean toRelatedUserBean(String str) {
            return str == null ? null : new RelatedUserBean();
        }

        @TypeConverter
        public static String toJson(RelatedUserBean bean) {
            return bean == null ? null : bean.toString();
        }
    }

    public static class ExtraBean {
    }

    public static class RelatedUserBean {
    }
}
